home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGBLER / HERCBIOS.LZH / HERCBIOS.DOC < prev    next >
Text File  |  1980-01-01  |  10KB  |  257 lines

  1.  
  2.                        *****   _H_E_R_C_B_I_O_S   *****
  3.           _B_I_O_S _P_A_T_C_H _F_O_R _T_H_E _H_E_R_C_U_L_E_S _B_O_A_R_D
  4.  
  5.                                Dave Tutelman  1986
  6.  
  7.  
  8.           The accompanying program is a front end to the INT 10 (VIDEO)
  9.         functions of the DOS BIOS, so that the important functions work
  10.         on a Hercules graphics board or its clones. (It was developed on
  11.         a SuperComputer clone of a Hercules) It is a
  12.         terminate-and-stay-resident program, that is installed by being
  13.         called; it is NOT a DOS driver. If you want it installed at boot,
  14.         include it in AUTOEXEC.BAT, not CONFIG.SYS.
  15.  
  16.         WHAT IT'S GOOD FOR
  17.  
  18.         The major strength of this program is that it will allow you to
  19.         write programs for the Hercules board that run in graphics mode,
  20.         and still write text easily on the graphics screen. With it, you
  21.         can program in those higher-level language processors that use
  22.         the DOS or BIOS calls for display, using their standard I/O calls
  23.         to write text to the graphics screen. (For a list of known
  24.         compatible and incompatible languages, see the section later in
  25.         this manual.)
  26.  
  27.         A second use of this program is to allow the running of existing
  28.         graphics programs that use the BIOS calls for ALL screen display.
  29.         It will NOT allow most commercial graphics programs written for
  30.         the the Color Graphics Adapter (CGA) to run on the Hercules
  31.         board. That is because most graphics programs write directly to
  32.         the video memory instead of using the BIOS calls. The only
  33.         existing graphics program that this has been tested against is
  34.         PC-LISP; that is the only graphics program I've encountered that
  35.         uses the BIOS exclusively.
  36.  
  37.  
  38.         HOW IT WORKS
  39.  
  40.         HERCBIOS is a terminate-and-stay-resident program that intercepts
  41.         all calls to Interrupt 10H, the BIOS video services. It will
  42.         either process the interrupt or pass the call on to the real
  43.         BIOS, depending on whether something specific to the Hercules
  44.         board needs to be done. Specifically, HERCBIOS handles the
  45.         interrupt itself if (1) the board is in graphics mode, or (2) the
  46.         BIOS call is a request to enter graphics mode.
  47.  
  48.         Two graphics modes are recognized and processed by HERCBIOS:
  49.  
  50.         Mode 6 - IBM Hi-res mode:  This uses part of the 720x348
  51.              Hercules raster as a 640x200 IBM-compatible graphics screen.
  52.              It will work with programs for the IBM CGA and its clones,
  53.              provided they use the BIOS services for their graphics
  54.              display. (Note - such programs are rare.)
  55.  
  56.         Mode 8 - Hercules-specific mode:  This uses the full
  57.  
  58.                                       - 1 -
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.              Hercules raster.
  68.  
  69.         Actually, both modes are quite capable of putting a pixel
  70.         anywhere on the Hercules raster.  The major difference is that
  71.         Mode 6 draws characters in an 8x8 pixel box (like the CGA), while
  72.         Mode 8 uses the finer resolution of the Hercules board to improve
  73.         legibility by using a 12x8 pixel box for characters. In either
  74.         mode, more characters than 25x80 will fit on the screen. Mode 6
  75.         supports 43x90 characters on the screen (but 25x80 inside the
  76.         640x200-pixel sub-screen); Mode 8 supports 29x90 characters.
  77.  
  78.         The functions implemented by HERCBIOS are:
  79.  
  80.                 Fn  0 - Set mode (6, 7, or 8)
  81.                 Fn  2 - Set cursor position
  82.                 Fn  3 - Read cursor position
  83.                 Fn  5 - New display page
  84.                 Fn  9 - Write character with attribute
  85.                 Fn 10 - Write character
  86.                 Fn 12 - Write pixel
  87.                 Fn 13 - Read pixel
  88.                 Fn 14 - Teletypewriter-style character write
  89.                 Fn 15 - Get video status
  90.  
  91.         Check your System Programmers' Guide for the use of these BIOS
  92.         functions.
  93.  
  94.         A number of properties of the alphanumeric display are not
  95.         supported by the hardware when you enter graphics mode. For
  96.         instance, the cursor is not shown in graphics mode, nor are all
  97.         of the character attributes. HERCBIOS does its best to emulate
  98.         the alphanumeric mode, but it cannot implement a cursor or the
  99.         blinking or bold attributes. The table below shows the "best
  100.         shot" that HERCBIOS takes at character attributes:
  101.  
  102.                 CODE    USUALLY MEANS           IBM MODE        HERC MODE
  103.                 00      invisible               invisible       invisible
  104.                 01      underline               [normal]        underline
  105.                 07      normal                  normal          normal
  106.                 0F      hi-intens               [rev video]     [rev video]
  107.                 70      rev video               rev video       rev video
  108.  
  109.  
  110.                 Anything else displays as normal
  111.  
  112.         The teletypewriter-style output protects the bottom line on the
  113.         screen as an unscrolled line, for status messages, function key
  114.         labels, etc. This is non-standard, but I like it. (And we do have
  115.         more rows than the CGA display. It's the 43rd line that isn't
  116.         scrolled.)
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.                                       - 2 -
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.         MAKING AND INSTALLING THE PROGRAM
  134.         Making the .COM File from Assembler Source
  135.  
  136.         HERCBIOS was originally developed on ASM 1.0. The version
  137.         included with this uses MASM 4.0. I don't know for sure whether
  138.         it will assemble with other versions of assembler.
  139.  
  140.         The commands for making HERCBIOS.COM from the source are in the
  141.         MAKEFILE included with the distribution. I run it with NDMAKE, an
  142.         excellent MS-DOS shareware MAKE from Don Knellers, but it should
  143.         be easy to adapt to your own favorite MAKE. If you make it by
  144.         hand, the commands are:
  145.  
  146.                 masm  hercbios;
  147.                 masm  gchar;
  148.                 masm  graph;
  149.                 link  hercbios gchar graph,  hercbios.exe;
  150.                 exe2bin  hercbios.exe hercbios.com
  151.                 del  hercbios.exe
  152.  
  153.         If you have a machine whose processor is an iAPX 286, 186, or
  154.         188, you may be able to get some increased performance and a
  155.         smaller .COM file by editing one character in the header file
  156.         hercbios.h. Simply remove the ";" that comments out the
  157.         definition of iAPX286. That will allow some non-8088 instructions
  158.         to assemble, as well as changing some code that was optimized for
  159.         speed (at the expense of storage and beauty) on the 8088. (This
  160.         option is known to assemble and link, but has not been tested; I
  161.         have no access to a 286 machine with Hercules graphics.)
  162.  
  163.  
  164.         Installing HERCBIOS.COM
  165.  
  166.         Once you have HERCBIOS.COM, store it where your PATH will find it
  167.         and add the line
  168.  
  169.                 HERCBIOS
  170.  
  171.         to your AUTOEXEC.BAT file somewhere after the PATH command. This
  172.         will cause it to be installed during boot, so it will be there
  173.         whenever you run your graphics programs. (Its presence won't
  174.         affect operation of your computer in alphanumeric mode, since it
  175.         passes on to the normal BIOS anything that's not in graphics
  176.         mode.)
  177.  
  178.         I am including a couple of demonstration/test programs in this
  179.         distribution, so that you can:
  180.            - See how to write programs for HERCBIOS.
  181.            - Test to assure that it runs with your computer and monitor.
  182.         The programs can be run in their executable form and their source
  183.         can be examined.
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.                                       - 3 -
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.         COMPATIBILITY AND INCOMPATIBILITY
  200.  
  201.         HERCBIOS has been tested on a Hercules board in an IBM PC-XT, a
  202.         Hercules-compatible board I built from a SuperComputer bare
  203.         board, and a Leading Edge XT clone. The current version works
  204.         with all of these, but I have a homebrew monitor that has trouble
  205.         syncing to the higher sweep rate of the monochrome display. If
  206.         you have trouble with the stability of your image, try fiddling
  207.         with the parameters for the 6845 display chip. They are in the
  208.         file HERCBIOS.ASM, in the "db" statement defining vid_parmtable
  209.         at the end of Function 0 (Set Video Mode). I have left in (but
  210.         commented out) the set of parameters that works on my homebrew
  211.         monitor.
  212.  
  213.         I have written programs using HERCBIOS in a number of languages.
  214.         Here are some of the caveats I'd like to pass on:
  215.  
  216.           - Things are fine using INT 10h calls in assembler.  (No big
  217.             surprise.)
  218.  
  219.           - Turbo Pascal works with HERCBIOS, with one caveat (at least
  220.             for releases 1 and 2). The Pascal cursor function GoTOXY will
  221.             home the cursor if presented with x>80 or y>25. To make full
  222.             use of the 29x90 or 43x90 screen, you will have to write your
  223.             own version of GoTOXY, using Turbo's machine language escape
  224.             to issue the INT 10h.
  225.  
  226.           - I've written a little in Microsoft C 3.0. No problems so far.
  227.  
  228.           - The TESTPIX program was written in deSmet C 2.4. It worked
  229.             fine, with one caveat. The console I/O routine getchar()
  230.             seems to write to display memory (perhaps as part of keyboard
  231.             echo). This can interfere with what is displayed on the
  232.             Hercules board display page 1.  (I had no problems on page
  233.             0.)
  234.  
  235.           - Forget about using it with BASICA or GWBASIC. Microsoft BASIC
  236.             graphics routines write directly to display memory,
  237.             completely bypassing the BIOS.
  238.  
  239.  
  240.         USE AND ENJOY!
  241.  
  242.         Bug reports to:
  243.                             Dave Tutelman
  244.                             16 Tilton Drive
  245.                             Wayside, NJ 07712
  246.  
  247.  
  248.                             Currently receive EMail at ...!mtuxo!mtuxt!dmt
  249.  
  250.  
  251.         Flames to:
  252.                             /dev/null
  253.  
  254.  
  255.  
  256.                                       - 4 -  
  257.